﻿using Dapper_Core.Basic;
using Dapper_Core.DAL.Interface;
using System;
using System.Collections.Generic;
using System.Text;

namespace Dapper_Core.DAL.Impl
{
    public class SyncReferenceFactory
    {
        /// <summary>
        /// 得到同步引用属性的实例
        /// </summary>
        /// <param name="dto">DTO</param>
        /// <returns></returns>
        public static ISyncReference GetInstance(BaseModel model)
        {
            switch (model.GetType().Name)
            {
                case "Sys_User_Role":
                    {
                        return new Sys_User_RoleSysncReference();
                    }
                case "Sys_Role_Menu":
                    {
                        return new Sys_Role_MenuSysncReference();
                    }
                default:
                    {
                        return new AbstractSyncReference();
                    }
            }
        }
    }
}
